package org.eclipse.mylyn.rememberthemilk.core;

import static org.junit.Assert.*;

import java.util.Date;

import org.eclipse.mylyn.internal.tasks.core.TaskTask;
import org.eclipse.mylyn.rememberthemilk.core.RTMAttributeMapper.Attribute;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.junit.Before;
import org.junit.Test;

@SuppressWarnings("restriction")
public class RtmRepositoryConnectorTests extends BaseRtmTests {
//	
//	private RTMRepositoryConnector connector;
//	private TaskRepository taskRepository;
//	private TaskAttributeMapper mapper;
//
//	@Before
//	public void setUp() {
//		connector = new RTMRepositoryConnector();
//		taskRepository = createTaskRepository();
//		mapper = new RTMAttributeMapper(taskRepository);
//	}
//	
//	@Test
//	public void testHasTaskChangedNewerTaskData() {
//		TaskTask task = new TaskTask("rtm", "rtm", "1");
//		Date modificationDate = new Date(1000);
//		task.setModificationDate(modificationDate);
//		TaskData taskData = new TaskData(mapper, "rtm", "rtm", "1");
//		createModifiedAttribute(taskData, "1200");
//
//		boolean changed = connector.hasTaskChanged(taskRepository, task, taskData);
//
//		assertTrue(changed);
//	}
//	
//	@Test
//	public void testHasTaskChangedNewerTask() {
//		TaskTask task = new TaskTask("rtm", "rtm", "1");
//		Date modificationDate = new Date(1200);
//		task.setModificationDate(modificationDate);
//		TaskData taskData = new TaskData(mapper, "rtm", "rtm", "1");
//		createModifiedAttribute(taskData, "1000");
//		
//		boolean changed = connector.hasTaskChanged(taskRepository, task, taskData);
//		
//		assertFalse(changed);
//	}
//
//	private void createModifiedAttribute(TaskData taskData, String value) {
//		taskData.getRoot().createAttribute(Attribute.MODIFIED.getRTMKey()).addValue(value);
//	}
	
}
